package com.sinothk.server.support.annotation.callback;

import com.sinothk.server.support.entity.ResultCode;
import lombok.Data;

/**
 * 全局异常处理
 *
 * @author chao.z
 */
@Data
public class BizException extends RuntimeException {
    private Integer code;
    private String msg;

    private ResultCode resultCode;

    public BizException(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public BizException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BizException(String msg) {
        this.code = 1001;
        this.msg = msg;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
